package com.yvtian.inv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.inv.pojo.InvMaterialReturnItemEntity;
import com.yvtian.inv.dao.InvMaterialReturnItemMapper;
import com.yvtian.inv.service.InvMaterialReturnItemService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 退料单(inv_material_return_item)表服务实现类
 *
 * @author long
 * @since 2024-07-02 13:43:39
 */
@Service("invMaterialReturnItemService")
public class InvMaterialReturnItemServiceImpl extends ServiceImpl<InvMaterialReturnItemMapper, InvMaterialReturnItemEntity> implements InvMaterialReturnItemService {

    @Override
    public IPage<InvMaterialReturnItemEntity> findByPage(Page<InvMaterialReturnItemEntity> page, InvMaterialReturnItemEntity invMaterialReturnItemEntity) {
        LambdaQueryWrapper<InvMaterialReturnItemEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(invMaterialReturnItemEntity.getZcode())) {
            queryWrapper.eq(InvMaterialReturnItemEntity::getZcode, invMaterialReturnItemEntity.getZcode());
        }
        return this.page(page, queryWrapper);
    }
}

